package com.sky.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.Date;

/**
 * @Author 王子旭
 * @Date 2025/03/20 23:23
 * @Version 1.0
 */
//@Component
@Slf4j
public class MyTask {
    /**
     * 定时任务每隔5s触发一次
     */
    @Scheduled(cron = "0/5 * * * * *")
    public void test() {
        log.info("定时任务开始执行：{}",new Date());
    }
}
